import 'package:flutter/material.dart';
import 'package:toast/toast.dart';

///提示框
class AlertUtil {
  String msg;
  BuildContext context;

  AlertUtil({@required this.msg, @required this.context});

  //底部
  AlertUtil.fromBottom(String msg, BuildContext context) {
    Toast.show(msg, context, gravity: Toast.BOTTOM);
  }

  //中间
  AlertUtil.fromCenter(String msg, BuildContext context) {
    Toast.show(msg, context, gravity: Toast.CENTER);
  }

  //顶部
  AlertUtil.fromTop(String msg, BuildContext context) {
    Toast.show(msg, context, gravity: Toast.TOP);
  }
}
